package com.liy.cloud.common.trade.service.impl;

import com.liy.cloud.common.trade.entity.TradeCommEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.liy.cloud.common.trade.dao.TradeCommDao;
import com.liy.cloud.common.trade.service.TradeCommService;
import com.das.framework.common.dao.IBaseDao;
import com.das.framework.common.service.impl.BaseServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * 设备交易基础信息表-公共表 Service接口服务实现
 *
 * @author
 * @ClassName: TradeCommServiceImpl
 * @Description:
 * @date: 2018-08-12 17:14:04
 */
@Service
public class TradeCommServiceImpl extends BaseServiceImpl<TradeCommEntity, String> implements TradeCommService {

    @Autowired
    private TradeCommDao tradecommDao;

    @Override
    public IBaseDao<TradeCommEntity, String> getDao() {
        return tradecommDao;
    }

    /**
     * @Author: liyang
     * @Date: 2018/8/29  14:54
     * @Description: 条件查询交易数据 条例如:
     * 1.特定某天(recvTime接收时间),
     * 2.某种设备(设备终端交易编号deviceId)
     *  这里传两位即可 例如 22 开头即代表TVM设备;  21 即代表AVM设备),
     **/
    @Override
    public List<TradeCommEntity> selectByReceiveTimeAndDeviceType(TradeCommEntity tradeCommEntity) throws Exception{
        return tradecommDao.selectByReceiveTimeAndDeviceType(tradeCommEntity);
    }

    /**
     * @Author:  liyang
     * @Date:    2018/8/30  14:03
     * @Description:  查询参数实体传入多个tradeCode值查询对应的单据
     *                TradeCommEntity.setTradeCodes( List<tradeCode> )
     **/
    @Override
    public List<TradeCommEntity> getDataByTradeCodeList(TradeCommEntity entity) {
        return tradecommDao.getDataByTradeCodeList(entity);
    }

    @Override
    public List<Map<String, Object>> getTradeCount() throws Exception {
        return tradecommDao.getTradeCount();
    }
}